<template>
	<view class="grid gap-2 p-2" style="grid-template-columns: repeat(3, 1fr);">
		<view v-for="item in list">
			<image class="w-full h-[200px]" :src="item.smallPicurl" />
			<div class="text-center">{{item.name}}</div>
		</view>
	</view>
</template>

<script setup lang="ts">
	import axios from 'axios';
	let list = ref([])

	onLoad((e) => {
		uni.setNavigationBarTitle({
			title: JSON.parse(decodeURIComponent(e.name))
		});
		initData(JSON.parse(decodeURIComponent(e.id)))
	})

	const initData = async (id : string) => {
		const res = await axios.get(`https://tea.qingnian8.com/api/bizhi/wallList?classid=${id}`)
		list.value = res.data.data
	}
</script>